1
What is SQL?
2
Tasks 1–4
3
Tasks 5–8
4
Exit Quiz
Lesson 4 Β· SQL

Introduction to SQL

Last lesson you used the Access GUI to build queries. Today you'll write the language underneath β€” the same SQL used by Spotify, Google, and every major tech company.

🎯
Learning Objectives
βœ“
Explain what SQL is and why it is universally used
βœ“
Write SELECT statements to choose fields and filter rows
βœ“
Use WHERE, ORDER BY, AND, OR, LIKE, and BETWEEN
βœ“
Compare SQL to what the QBE grid was doing in Access
πŸ’‘
Why SQL?

SQL stands for Structured Query Language. It was invented in the 1970s and is still the language used to talk to databases today β€” by Spotify, Amazon, the NHS, and millions of other systems.

The secret you've already learned: Every time you clicked in the Access Query Design grid last lesson, Access was secretly writing SQL behind the scenes. Today you cut out the middleman and write it yourself.

SQL is used on every operating system, in every programming language, and with every major database system. Learning it now means you're learning a skill that will last your entire career.

βš™οΈ
How to Open SQL View in Access
1
Click Create in the ribbon β†’ click Query Design
2
Close the "Show Table" dialog that appears (click Close)
3
Click the View dropdown β†’ select SQL View
4
Type your SQL and click Run (the red exclamation mark !)
Keep the SQL Reference card open: Open SQL Reference β†’ β€” open it in a new tab while you work.
Tasks 1–4 Β· Building Up

SQL Tasks 1–4

Open DataDrop_L4.accdb in Access. For each task, open SQL View, type your query, run it, and record the results below.

Remember: Access uses double-quotes around text values and * as the wildcard (not %). Each query ends with a semicolon ;
Q1
Show Everything
Brief: Show all fields and all records in the Songs table.
How many records returned?
How many columns (fields)?
Q2
Select Specific Fields
Brief: Show only the Title and Artist columns for every song.
How is this different from Q1?
Q3
Filter with WHERE
Brief: Show all fields for songs in the Pop genre only.
How many Pop songs are there?
Q4
Sort with ORDER BY
Brief: Show Title, Artist, and Streams for songs with over 1 million streams, sorted from most to least popular.
Which song is at the top?
What keyword sorts results?
Tasks 5–8 Β· Advanced Filtering

SQL Tasks 5–8

These tasks use AND, OR, LIKE, and BETWEEN β€” the building blocks of every real SQL query.

Q5
AND β€” Two Conditions
Brief: Show all fields for songs that are Pop AND have over 7 million streams.
How many records?
Name one song from the results:
Q6
OR β€” Either Condition
Brief: Show Title, Artist, and Genre for songs that are either Pop OR Electronic.
How is the number of results different from Q3 (Pop only)? Why?
Q7
LIKE β€” Wildcard Search
Brief: Show all fields for songs where the Title begins with "The".
List the song titles returned:
Q8
BETWEEN β€” Range Query
Brief: Show Title, Artist, and ReleaseYear for songs released between 2019 and 2021 (inclusive), sorted alphabetically by Title.
How many records?
First song alphabetically?
πŸš€ Extension
GUI β†’ SQL Translation
Open one of your saved queries from Lesson 3 in Access. Switch to SQL View (View β†’ SQL View). Access will show you the SQL it generated. Compare it to your own SQL from today β€” is it the same? What differences do you notice?
Final Check

Exit Quiz

βœ…
Lesson 4 Check
πŸ“€
Export Your Answers

Download all your answers from every section as a text file β€” then upload to Google Classroom.

🎡
Lesson Complete!

You can now write real SQL. Next lesson: you'll build Forms and Reports to make your database accessible to non-technical users.

Go to Lesson 5 β†’